//
//  FitmentModel.m
//  PerfectWorld
//
//  Created by dllo on 16/8/31.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "FitmentModel.h"
#import "Color.h"
#import "StyleModel.h"
#import "SpaceModel.h"
@implementation FitmentModel

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"color"]) {
        NSMutableArray<Color *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Color * color = [Color modelWithDic:dic];
            [array addObject:color];
        }
        _color = array;
    }
    if ([key isEqualToString:@"style"]) {
        NSMutableArray<StyleModel *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            StyleModel * style = [StyleModel modelWithDic:dic];
            [array addObject:style];
        }
        _style = array;
    }
    if ([key isEqualToString:@"space"]) {
        NSMutableArray<SpaceModel *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            SpaceModel * space = [SpaceModel modelWithDic:dic];
            [array addObject:space];
        }
        _space = array;
    }
}

@end
